<!DOCTYPE html>
<html>
<head>
    <title>商品工艺配置</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <el-tabs v-model="activeName" type="border-card">

        <el-tab-pane label="商务印刷工艺" name="first" style="width: 100%">
            <!--查询-->
            <el-form :inline="true" class="demo-form-inline" size="small">
                <el-form-item label="工艺名称">
                    <el-input v-model="print.query.craftName" ></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="searchPrint">查询</el-button>
                </el-form-item>
            </el-form>

            <!--商务印刷工艺配置表格-->
            <el-table size="mini" :data="print.goodsCraftConfigData" border style="width: 100%">

                <el-table-column prop="craftName" label="工艺名称"></el-table-column>

                <el-table-column prop="quantityOfOne" label="组成一个的数量" width="150"></el-table-column>

                <el-table-column prop="quantityOfComplete" label="成品数量" width="150"></el-table-column>

                <el-table-column prop="endPartCountText" label="是否最后一个部件才算价" width="100"></el-table-column>

                <el-table-column prop="craftFormula" label="算价公式"></el-table-column>

                <el-table-column prop="craftFormulaTitle" label="算价公式描述"></el-table-column>

               <!-- <el-table-column
                        label="开关"
                        width="80">
                    <template slot-scope="scope">
                        <el-switch
                                v-if="scope.row.id != null"
                                style="display: block"
                                v-model="scope.row.delFlag"
                                @change="switchChange(scope.row)"
                                active-color="#13ce66"
                                inactive-color="#ff4949"
                                :active-value=0
                                :inactive-value="1">
                        </el-switch>
                    </template>
                </el-table-column>-->

                <el-table-column
                        label="操作"
                        width="100">
                    <template slot-scope="scope">
                        <el-button
                                @click.native.prevent.stop="editPrint(scope.$index, scope.row)"
                                size="mini"
                                size="small">
                            编辑
                        </el-button>
                    </template>
                </el-table-column>

            </el-table>

            <!--分页插件-->
            <div style="text-align: center;margin: 15px">
                <el-pagination
                        @size-change="handlePrintSizeChange"
                        @current-change="handlePrintCurrentChange"
                        :current-page="print.page.currentPage"
                        :page-sizes="print.page.pageSizes"
                        :page-size="print.page.pageSize"
                        layout="total, sizes, prev, pager, next"
                        :total="print.page.total">
                </el-pagination>
            </div>
        </el-tab-pane>

        <el-tab-pane label="数码快印工艺" name="second" style="width: 100%">
            <!--查询-->
            <el-form :inline="true" class="demo-form-inline" size="small">
                <el-form-item label="工艺名称">
                    <el-input v-model="fast.query.craftName" ></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="searchFast">查询</el-button>
                </el-form-item>
            </el-form>

            <!--数码快印商品工艺配置表格-->
            <el-table size="mini" :data="fast.goodsCraftConfigData" border style="width: 100%">

                <el-table-column prop="craftName" label="工艺名称"></el-table-column>

                <el-table-column prop="quantityOfOne" label="组成一个的数量" width="150"></el-table-column>

                <el-table-column prop="quantityOfComplete" label="成品数量" width="150"></el-table-column>

                <el-table-column prop="endPartCountText" label="是否最后一个部件才算价" width="100"></el-table-column>

                <el-table-column prop="craftFormula" label="算价公式"></el-table-column>

                <el-table-column prop="craftFormulaTitle" label="算价公式描述"></el-table-column>

                <el-table-column
                        label="操作"
                        width="100">
                    <template slot-scope="scope">
                        <el-button
                                @click.native.prevent.stop="editFast(scope.$index, scope.row)"
                                size="mini"
                                size="small">
                            编辑
                        </el-button>
                    </template>
                </el-table-column>

            </el-table>

            <!--分页插件-->
            <div style="text-align: center;margin: 15px">
                <el-pagination
                        @size-change="handleFastSizeChange"
                        @current-change="handleFastCurrentChange"
                        :current-page="fast.page.currentPage"
                        :page-sizes="fast.page.pageSizes"
                        :page-size="fast.page.pageSize"
                        layout="total, sizes, prev, pager, next"
                        :total="fast.page.total">
                </el-pagination>
            </div>
        </el-tab-pane>

        <el-tab-pane label="标准商品工艺" name="third">
            <!--查询-->
            <el-form :inline="true" class="demo-form-inline" size="small">
                <el-form-item label="工艺名称">
                    <el-input v-model="standard.query.craftName" ></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="searchStandard">查询</el-button>
                </el-form-item>
            </el-form>
            <!--标工艺配置表格-->
            <el-table size="mini" :data="standard.goodsCraftConfigData" border style="width: 100%">

                <el-table-column prop="craftName" label="工艺名称"></el-table-column>

                <el-table-column prop="craftFormula" label="算价公式"></el-table-column>

                <el-table-column prop="craftFormulaTitle" label="算价公式描述"></el-table-column>

                <el-table-column
                        label="操作"
                        width="100">
                    <template slot-scope="scope">
                        <el-button
                                @click.native.prevent.stop="editStandard(scope.$index, scope.row)"
                                size="mini"
                                size="small">
                            编辑
                        </el-button>
                    </template>
                </el-table-column>

            </el-table>

            <!--分页插件-->
            <div style="text-align: center;margin: 15px">
                <el-pagination
                        @size-change="handleStandardSizeChange"
                        @current-change="handleStandardCurrentChange"
                        :current-page="standard.page.currentPage"
                        :page-sizes="standard.page.pageSizes"
                        :page-size="standard.page.pageSize"
                        layout="total, sizes, prev, pager, next"
                        :total="standard.page.total">
                </el-pagination>
            </div>
        </el-tab-pane>
    </el-tabs>

    <!--商务印刷编辑弹窗-->
    <el-dialog :title="print.title" :visible.sync="print.dialogFormVisible">
        <el-form :model="print.currentRow" label-width="130px">
            <el-form-item label="组成的一个数量" >
                <el-input v-model="print.currentRow.quantityOfOne" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="成品数量" >
                <el-input v-model="print.currentRow.quantityOfComplete" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="最后一个部件算价" >
                <el-switch
                        v-model="print.currentRow.endPartCount"
                        active-value=1
                        inactive-value=0
                        active-text="是"
                        inactive-text="否"
                        active-color="#13ce66"
                        inactive-color="#ff4949">
                </el-switch>
            </el-form-item>
            <el-form-item label="算价公式" >
                <el-input v-model="print.currentRow.craftFormula" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="算价公式描述" >
                <el-input v-model="print.currentRow.craftFormulaTitle" autocomplete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="print.dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="saveOrUpdatePrint(print.currentRow)">确 定</el-button>
        </div>
    </el-dialog>

    <!--数码快印编辑弹窗-->
    <el-dialog :title="fast.title" :visible.sync="fast.dialogFormVisible">
        <el-form :model="fast.currentRow" label-width="130px">
            <el-form-item label="组成的一个数量" >
                <el-input v-model="fast.currentRow.quantityOfOne" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="成品数量" >
                <el-input v-model="fast.currentRow.quantityOfComplete" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="最后一个部件算价" >
                <el-switch
                        v-model="fast.currentRow.endPartCount"
                        active-value=1
                        inactive-value=0
                        active-text="是"
                        inactive-text="否"
                        active-color="#13ce66"
                        inactive-color="#ff4949">
                </el-switch>
            </el-form-item>
            <el-form-item label="算价公式" >
                <el-input v-model="fast.currentRow.craftFormula" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="算价公式描述" >
                <el-input v-model="fast.currentRow.craftFormulaTitle" autocomplete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="fast.dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="saveOrUpdateFast(fast.currentRow)">确 定</el-button>
        </div>
    </el-dialog>

    <!--标品编辑弹窗-->
    <el-dialog :title="standard.title" :visible.sync="standard.dialogFormVisible">
        <el-form :model="standard.currentRow" label-width="130px">
            <el-form-item label="算价公式" >
                <el-input v-model="standard.currentRow.craftFormula" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="算价公式描述" >
                <el-input v-model="standard.currentRow.craftFormulaTitle" autocomplete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="standard.dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="saveOrUpdateStandard(standard.currentRow)">确 定</el-button>
        </div>
    </el-dialog>


</div>

<script src="${request.contextPath}/statics/js/modules/craftConfig/goodscraftconfig.js?_${.now?long}"></script>
</body>
</html>